<?php
/**
 * Default Page Template
 *
 * @package OWL
 * @subpackage Default Template
 * @author KeiMOon
 * @since 1.0
 */

class Template_Page extends Owl_Master_Template {
    protected function init() {
        $nice_url = $_GET["var"];
        $this->owl_page = new Owl_Page();
        if (empty($nice_url)) {
            Owl_Functions::go_to_template("pages-list");
        }
        $this->current_page = $this->owl_page->get_page($nice_url);
        if (!$this->current_page) {
            Owl_Functions::go_to_template("pages-list");
        }
        assign("title", get_option("site_name") . " - " . $this->current_page["title"]);
    }

    protected function main_content() {
        Owl_Default_Content::print_page_content($this->current_page);
    }

}
